/*************************************************************************
	> File Name: 6-2.c
	> Author: Angel Criss
	> Mail: abbytsing@gmail.com 
	> Created Time: Fri Jul 25 19:58:36 2014
 ************************************************************************/
// the abuse of longjmp will cause a infinity loop

#include<stdio.h>
#include<setjmp.h>

static jmp_buf env;

int add(int c, int d)
{
    return c+d;
}

int main(int argc,char *argv[])
{
    int a=1;
    int b=2;
    int c;

    c=add(a,b);

    printf ("the c is : %d\n",c);

    setjmp(env);

    longjmp(env,add(a,b));
}
